import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/Index',
    name: 'Index',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* 懒加载 */ '../views/Index.vue'),
    children:[
      {path:'order',name:'Order',component:()=>import('../views/modules/Order-management/Order-management')},
      {path:'/Index',name:'home',component:()=>import('../views/modules/Home/Home')},

      {path:'productList',name:'productList',component:()=>import('../views/modules/Product-management/Product-list')},
      {path:'productAdd',name:'productAdd',component:()=>import('../views/modules/Product-management/Product-add')},
      {path:'classification',name:'classification',component:()=>import('../views/modules/Product-management/classification')},

      {path:'store',name:'store',component:()=>import('../views/modules/Store-management/Store-management')},

      {path:'AccountList',name:'AccountList',component:()=>import('../views/modules/account-management/AccountList')},
      {path:'Addaccount',name:'Addaccount',component:()=>import('../views/modules/account-management/Addaccount')},
      {path:'ChangePw',name:'ChangePw',component:()=>import('../views/modules/account-management/ChangePw')},

      {path:'ProStatistics',name:'ProStatistics',component:()=>import('../views/modules/Sales-statistics/Pro-Statistics')},
      {path:'OrderStatistics',name:'OrderStatistics',component:()=>import('../views/modules/Sales-statistics/Order-Statistics')},

      {path:'Center',name:'Center',component:()=>import('../views/modules/Center/Center')},

    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
